package com.pig4cloud.pig.facility.feign.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;

@Data
@TableName("property_facility")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "facility 表")
public class Facility extends Model<Facility> {
	/**
	 * 主键
	 */
	@TableId(type = IdType.ASSIGN_ID)
	@Schema(description="主键")
	private Long facilityId;

	/**
	 * 设施名
	 */
	@Schema(description="设施名")
	private String facilityName;

	/**
	 * 设施类型
	 */
	@Schema(description="设施类型")
	private String facilityType;

	/**
	 * 设施负责人
	 */
	@Schema(description="设施负责人")
	private String facilityResponsePeople;

	/**
	 * 设施联系人
	 */
	@Schema(description="设施联系人")
	private String facilityContactPeople;

	/*
	 * 电话
	 */
	@Schema(description="联系电话")
	@Pattern(regexp = "^1[3-9]\\d{9}$", message = "电话号码格式不正确")
	private String contactPhone;

	/*
	 * 设施地址
	 */
	@Schema(description="设施地址")
	private String facilityLocation;

	/*
	 * 创建人
	 */
	@TableField(fill = FieldFill.INSERT)
	@Schema(description="创建人")
	private String createBy;

	/*
	 * 修改人
	 */
	@TableField(fill = FieldFill.INSERT_UPDATE)
	@Schema(description="更新人")
	private String updateBy;

	/*
	 * 创建时间
	 */
	@TableField(fill = FieldFill.INSERT)
	@Schema(description="创建时间")
	private LocalDateTime createTime;

	/*
	 * 修改时间
	 */
	@TableField(fill = FieldFill.INSERT_UPDATE)
	@Schema(description="修改时间")
	private LocalDateTime updateTime;

	/*
	 * 删除标志
	 */
	@TableLogic // 标记为逻辑删除字段，默认 0 为未删除，1 为已删除
	private String delFlag;

	/*
	 * 备注
	 */
	@Schema(description="备注")
	private String remark;

}
